define(function(require, exports, module) {

  var Backbone = require('backbone');
  var $ = require('jquery');
  var _ = require('underscore');
  var jsonview = require('jsonview');
  var vec2 = require('js/graph/vector')
  var graph = require('js/graph/graph')

  var ce = require('v/graph-zrender/topo/util/createEl')
  var points = [
    [
      51.56741944216367,
      195.11490566037736
    ],
    [
      54.49545423540996,
      198.352
    ],
    [
      57.42348902865625,
      192.45354285714285
    ],
    [
      60.35152382190253,
      192.1745918367347
    ],
    [
      63.27955861514882,
      193.83429787234041
    ],
    [
      66.20759340839511,
      195.77669333333333
    ],
    [
      69.1356282016414,
      193.58258536585367
    ],
    [
      72.0636629948877,
      193.338
    ],
    [
      74.99169778813398,
      195.76277192982457
    ],
    [
      77.91973258138027,
      200.096
    ],
    [
      80.84776737462656,
      193.20175
    ],
    [
      83.77580216787285,
      197.33285
    ],
    [
      86.70383696111914,
      196.25844827586207
    ],
    [
      89.63187175436542,
      196.38161538461537
    ],
    [
      92.55990654761172,
      196.2826769230769
    ],
    [
      95.487941340858,
      192.524338028169
    ],
    [
      98.4159761341043,
      193.22899999999998
    ],
    [
      101.34401092735058,
      203.70208333333335
    ],
    [
      104.27204572059688,
      195.36288461538462
    ],
    [
      107.20008051384316,
      198.02844210526317
    ],
    [
      110.12811530708944,
      192.99220689655172
    ],
    [
      113.05615010033574,
      196.03285106382978
    ],
    [
      115.98418489358203,
      198.48023529411765
    ],
    [
      118.91221968682831,
      193.62307692307692
    ],
    [
      121.8402544800746,
      192.16162264150944
    ],
    [
      124.76828927332089,
      192.94514583333333
    ],
    [
      127.69632406656717,
      195.49709589041095
    ],
    [
      130.62435885981347,
      205.5261818181818
    ],
    [
      133.55239365305977,
      194.2041081081081
    ],
    [
      136.48042844630606,
      197.45275
    ],
    [
      139.40846323955233,
      195.51202739726028
    ],
    [
      142.33649803279863,
      195.54070833333333
    ],
    [
      145.2645328260449,
      194.668776119403
    ],
    [
      148.1925676192912,
      195.00933333333333
    ],
    [
      151.1206024125375,
      199.8998
    ],
    [
      154.0486372057838,
      198.4592131147541
    ],
    [
      156.9766719990301,
      198.6854117647059
    ],
    [
      159.90470679227633,
      197.46923456790122
    ],
    [
      162.83274158552265,
      193.09705263157895
    ],
    [
      165.76077637876892,
      194.87547368421053
    ],
    [
      168.68881117201522,
      193.2555135135135
    ],
    [
      171.61684596526152,
      195.39241304347826
    ],
    [
      174.54488075850782,
      188.06575384615385
    ],
    [
      177.47291555175408,
      193.67461764705882
    ],
    [
      180.40095034500038,
      107.43652173913041
    ],
    [
      183.32898513824668,
      127.18847191011236
    ],
    [
      186.25701993149295,
      132.5378
    ],
    [
      189.18505472473925,
      115.36930909090908
    ],
    [
      192.11308951798554,
      126.41199999999999
    ],
    [
      195.0411243112318,
      103.74000000000001
    ],
    [
      197.9691591044781,
      115.0690425531915
    ],
    [
      200.8971938977244,
      110.18090909090908
    ],
    [
      203.82522869097068,
      116.06273684210527
    ],
    [
      206.75326348421697,
      122.3136
    ],
    [
      209.68129827746327,
      116.23592452830188
    ],
    [
      212.60933307070954,
      125.87478571428571
    ],
    [
      215.53736786395586,
      139.74535135135136
    ],
    [
      218.46540265720213,
      117.54666666666665
    ],
    [
      221.3934374504484,
      86.87325925925927
    ],
    [
      224.32147224369473,
      118.07408602150537
    ],
    [
      227.249507036941,
      120.02482474226805
    ],
    [
      230.1775418301873,
      129.74781132075472
    ],
    [
      233.1055766234336,
      125.00036065573771
    ],
    [
      236.0336114166799,
      147.79416666666668
    ],
    [
      238.96164620992616,
      112.42063888888889
    ],
    [
      241.88968100317246,
      111.5630857142857
    ],
    [
      244.81771579641872,
      110.89851162790698
    ],
    [
      247.74575058966502,
      119.64768115942029
    ],
    [
      250.6737853829113,
      108.69111538461539
    ],
    [
      253.60182017615762,
      119.11335999999999
    ],
    [
      256.5298549694039,
      121.72500000000001
    ],
    [
      259.4578897626502,
      119.61957894736842
    ],
    [
      262.38592455589645,
      108.71247619047621
    ],
    [
      265.31395934914275,
      135.7424
    ],
    [
      268.241994142389,
      129.4531
    ],
    [
      NaN,
      NaN
    ],
    [
      274.09806372888164,
      117.692
    ],
    [
      277.0260985221279,
      109.19
    ],
    [
      279.9541333153742,
      115.77562790697674
    ],
    [
      282.8821681086205,
      119.90833333333335
    ],
    [
      285.8102029018668,
      125.1324347826087
    ],
    [
      288.73823769511307,
      110.85261333333332
    ],
    [
      291.66627248835937,
      126.03545454545454
    ],
    [
      294.59430728160567,
      137.41261538461538
    ],
    [
      297.52234207485196,
      114.63559595959597
    ],
    [
      300.4503768680982,
      124.06330952380952
    ],
    [
      303.3784116613445,
      115.98692857142858
    ],
    [
      306.3064464545908,
      118.54858585858588
    ],
    [
      309.2344812478371,
      114.68510344827588
    ],
    [
      312.1625160410834,
      120.79849999999999
    ],
    [
      315.0905508343297,
      115.4459393939394
    ],
    [
      318.01858562757593,
      134.47194444444443
    ],
    [
      320.9466204208223,
      124.30589830508475
    ],
    [
      323.8746552140685,
      105.86186666666666
    ],
    [
      326.8026900073148,
      128.36420224719103
    ],
    [
      329.7307248005611,
      109.99129729729728
    ],
    [
      332.6587595938074,
      118.12546511627907
    ],
    [
      335.58679438705366,
      112.25347368421053
    ],
    [
      338.5148291803,
      88.47999999999999
    ],
    [
      341.4428639735463,
      121.68503333333332
    ],
    [
      344.37089876679255,
      109.6217254901961
    ],
    [
      347.29893356003885,
      115.27962637362639
    ],
    [
      350.22696835328514,
      130.135868852459
    ],
    [
      353.1550031465314,
      118.6161971830986
    ],
    [
      356.08303793977774,
      118.66955789473684
    ],
    [
      359.01107273302404,
      110.48393548387097
    ],
    [
      361.9391075262703,
      108.98584126984127
    ],
    [
      364.8671423195166,
      110.20733333333334
    ],
    [
      367.7951771127629,
      115.53095652173914
    ],
    [
      370.72321190600917,
      117.84024000000001
    ],
    [
      373.65124669925547,
      105.811
    ],
    [
      376.57928149250176,
      121.10992857142857
    ],
    [
      379.507316285748,
      135.59222222222223
    ],
    [
      382.4353510789943,
      123.2720350877193
    ],
    [
      385.3633858722406,
      127.16326153846154
    ],
    [
      388.2914206654869,
      104.80819999999999
    ],
    [
      391.2194554587332,
      111.0975
    ],
    [
      394.1474902519795,
      119.59213513513514
    ],
    [
      397.0755250452258,
      100.1648
    ],
    [
      400.00355983847203,
      118.96934375
    ],
    [
      402.9315946317183,
      112.34261538461539
    ],
    [
      405.8596294249646,
      99.13665116279071
    ],
    [
      408.7876642182109,
      183.77714285714285
    ],
    [
      411.7156990114572,
      125.45335897435896
    ],
    [
      414.6437338047035,
      122.3668888888889
    ],
    [
      417.57176859794976,
      112.01510204081634
    ],
    [
      420.49980339119605,
      135.42266666666666
    ],
    [
      423.42783818444235,
      131.42279411764707
    ],
    [
      426.35587297768865,
      125.14888235294117
    ],
    [
      429.2839077709349,
      125.07574074074074
    ],
    [
      432.2119425641812,
      130.04652459016393
    ],
    [
      435.13997735742754,
      116.59830508474576
    ],
    [
      438.06801215067384,
      130.1616
    ],
    [
      440.99604694392013,
      122.39457142857142
    ],
    [
      443.9240817371664,
      110.36074074074072
    ],
    [
      446.8521165304127,
      103.27285714285716
    ],
    [
      449.78015132365897,
      153.5997142857143
    ],
    [
      452.70818611690527,
      126.6418909090909
    ],
    [
      455.6362209101515,
      128.19664406779663
    ],
    [
      458.5642557033978,
      72.13
    ],
    [
      461.4922904966441,
      118.94913333333334
    ],
    [
      464.42032528989034,
      117.73960919540231
    ],
    [
      467.34836008313664,
      119.92579220779221
    ],
    [
      470.276394876383,
      132.4812463768116
    ],
    [
      473.2044296696293,
      130.1065263157895
    ],
    [
      476.1324644628756,
      123.82779166666666
    ],
    [
      479.0604992561219,
      137.42619047619047
    ],
    [
      481.9885340493681,
      81.60088888888887
    ],
    [
      484.9165688426144,
      125.72620833333333
    ],
    [
      487.8446036358607,
      105.33234782608696
    ],
    [
      490.77263842910696,
      121.3487741935484
    ],
    [
      493.70067322235326,
      112.90613953488372
    ],
    [
      496.62870801559956,
      121.117325
    ],
    [
      499.55674280884585,
      115.02803999999999
    ],
    [
      502.4847776020922,
      130.02229268292683
    ],
    [
      505.4128123953385,
      126.16977777777778
    ],
    [
      508.34084718858475,
      112.82333333333334
    ],
    [
      511.26888198183104,
      119.9156
    ],
    [
      514.1969167750774,
      102.97043373493975
    ],
    [
      517.1249515683236,
      103.44272727272727
    ],
    [
      520.0529863615699,
      133.67597530864197
    ],
    [
      522.9810211548162,
      113.63031578947368
    ],
    [
      525.9090559480625,
      126.86616666666666
    ],
    [
      528.8370907413087,
      121.28338144329896
    ],
    [
      531.765125534555,
      128.374
    ],
    [
      NaN,
      NaN
    ],
    [
      537.6211951210477,
      118.16171134020618
    ],
    [
      540.549229914294,
      120.43172972972972
    ],
    [
      543.4772647075403,
      100.17191836734693
    ],
    [
      546.4052995007864,
      97.99061333333333
    ],
    [
      549.3333342940327,
      120.93684615384615
    ],
    [
      552.261369087279,
      101.9318823529412
    ],
    [
      555.1894038805253,
      126.4992
    ],
    [
      558.1174386737716,
      118.21214035087719
    ],
    [
      561.0454734670179,
      124.63251162790698
    ],
    [
      563.9735082602642,
      135.73645454545454
    ],
    [
      566.9015430535105,
      107.64842857142858
    ],
    [
      569.8295778467568,
      117.9536
    ],
    [
      572.7576126400031,
      113.38936842105262
    ],
    [
      575.6856474332494,
      129.8595463917526
    ],
    [
      578.6136822264957,
      111.66066666666667
    ],
    [
      581.541717019742,
      136.06548717948718
    ],
    [
      NaN,
      NaN
    ],
    [
      587.3977866062345,
      123.47868888888888
    ],
    [
      590.3258213994808,
      121.07342222222223
    ],
    [
      593.2538561927271,
      121.689575
    ],
    [
      596.1818909859734,
      133.38326086956522
    ],
    [
      599.1099257792197,
      121.10072727272727
    ],
    [
      602.037960572466,
      135.10085714285714
    ],
    [
      604.9659953657123,
      109.48831578947367
    ],
    [
      607.8940301589586,
      117.1130888888889
    ],
    [
      610.8220649522049,
      120.00023529411764
    ],
    [
      613.7500997454512,
      131.9056
    ],
    [
      616.6781345386975,
      126.91861971830986
    ],
    [
      619.6061693319438,
      122.24114705882353
    ],
    [
      622.5342041251901,
      122.53539130434783
    ],
    [
      625.4622389184362,
      122.00396610169491
    ],
    [
      628.3902737116825,
      107.7948
    ],
    [
      631.3183085049288,
      118.22370731707316
    ],
    [
      634.2463432981751,
      122.706
    ],
    [
      637.1743780914214,
      112.71040540540541
    ],
    [
      640.1024128846677,
      117.25164
    ],
    [
      643.030447677914,
      116.23081081081081
    ],
    [
      645.9584824711603,
      105.53101960784313
    ],
    [
      648.8865172644066,
      119.66347826086955
    ],
    [
      651.8145520576529,
      116.15652173913043
    ],
    [
      654.7425868508992,
      119.58432989690722
    ],
    [
      657.6706216441455,
      107.44599999999998
    ],
    [
      660.5986564373918,
      134.15475862068968
    ],
    [
      663.526691230638,
      123.18224615384615
    ],
    [
      666.4547260238843,
      114.73031428571429
    ],
    [
      669.3827608171306,
      132.96720930232556
    ],
    [
      672.3107956103769,
      83.20439999999999
    ],
    [
      675.2388304036233,
      135.24099999999999
    ],
    [
      678.1668651968695,
      120.00037777777779
    ],
    [
      681.0948999901158,
      119.2616
    ],
    [
      684.0229347833621,
      120.199
    ],
    [
      686.9509695766084,
      84.12
    ],
    [
      689.8790043698547,
      123.29365217391305
    ],
    [
      692.807039163101,
      117.65208450704225
    ],
    [
      695.7350739563473,
      132.51600000000002
    ],
    [
      698.6631087495934,
      115.46355555555557
    ],
    [
      701.5911435428397,
      109.11733333333333
    ],
    [
      704.519178336086,
      131.27846464646464
    ],
    [
      707.4472131293323,
      116.49889189189189
    ],
    [
      710.3752479225788,
      96.48371428571429
    ],
    [
      713.303282715825,
      152.06333333333333
    ],
    [
      716.2313175090712,
      125.89624390243902
    ],
    [
      719.1593523023175,
      122.9079705882353
    ],
    [
      722.0873870955638,
      131.8229552238806
    ],
    [
      725.0154218888101,
      125.26574193548387
    ],
    [
      727.9434566820564,
      120.98123529411764
    ],
    [
      730.8714914753027,
      113.73026923076924
    ],
    [
      733.799526268549,
      117.94429213483147
    ],
    [
      736.7275610617952,
      118.60665217391305
    ],
    [
      739.6555958550415,
      110.45517857142858
    ],
    [
      742.5836306482878,
      132.54586301369864
    ],
    [
      745.5116654415342,
      132.28346666666667
    ],
    [
      748.4397002347805,
      127.26765
    ],
    [
      751.3677350280267,
      119.71413793103449
    ],
    [
      754.295769821273,
      118.36157142857144
    ],
    [
      757.2238046145193,
      112.03512244897959
    ],
    [
      760.1518394077656,
      128.26055102040817
    ],
    [
      763.0798742010119,
      116.95212121212121
    ],
    [
      766.0079089942582,
      124.6048947368421
    ],
    [
      768.9359437875045,
      136.0476
    ],
    [
      771.8639785807508,
      131.8940588235294
    ],
    [
      774.792013373997,
      129.3005
    ],
    [
      777.7200481672432,
      118.66063917525773
    ],
    [
      780.6480829604897,
      115.61222988505747
    ],
    [
      783.576117753736,
      102.56751351351352
    ],
    [
      786.5041525469823,
      131.66822222222223
    ],
    [
      789.4321873402284,
      130.78335416666667
    ],
    [
      792.3602221334747,
      111.52651282051282
    ],
    [
      795.288256926721,
      110.9218888888889
    ],
    [
      798.2162917199674,
      105.46290322580644
    ],
    [
      801.1443265132136,
      118.57748453608247
    ],
    [
      804.0723613064599,
      113.39428571428572
    ],
    [
      807.0003960997062,
      122.10901538461538
    ],
    [
      809.9284308929525,
      125.33445714285715
    ],
    [
      812.8564656861987,
      141.43583333333333
    ],
    [
      815.7845004794451,
      139.3714588235294
    ],
    [
      818.7125352726913,
      125.16688461538462
    ],
    [
      821.6405700659377,
      118.77884057971015
    ],
    [
      824.5686048591839,
      10
    ],
    [
      827.4966396524302,
      116.83767567567567
    ],
    [
      830.4246744456765,
      124.12773913043479
    ],
    [
      833.3527092389228,
      115.34272941176471
    ],
    [
      836.2807440321692,
      112.91276923076923
    ],
    [
      839.2087788254154,
      123.41030769230768
    ],
    [
      842.1368136186617,
      116.7832842105263
    ],
    [
      845.064848411908,
      121.09069879518073
    ],
    [
      847.9928832051543,
      119.69191304347825
    ],
    [
      850.9209179984005,
      117.22756521739132
    ],
    [
      853.8489527916469,
      109.3149512195122
    ],
    [
      856.776987584893,
      119.63896551724137
    ],
    [
      859.7050223781395,
      127.25712328767123
    ],
    [
      862.6330571713856,
      144.21915789473684
    ],
    [
      865.5610919646319,
      122.41187301587303
    ],
    [
      868.4891267578784,
      131.4715164835165
    ],
    [
      871.4171615511245,
      124.59533333333333
    ],
    [
      874.345196344371,
      107.20505263157897
    ],
    [
      877.2732311376171,
      84.50755555555557
    ],
    [
      880.2012659308634,
      120.71317171717172
    ],
    [
      883.1293007241097,
      127.53642105263157
    ],
    [
      886.057335517356,
      120.80062337662339
    ],
    [
      888.9853703106022,
      79.52523076923075
    ],
    [
      891.9134051038486,
      117.09536842105263
    ],
    [
      894.8414398970948,
      126.5962619047619
    ],
    [
      897.7694746903412,
      119.81233684210527
    ],
    [
      900.6975094835875,
      119.40485714285714
    ],
    [
      903.6255442768337,
      134.28564705882354
    ],
    [
      906.5535790700801,
      125.75800000000001
    ],
    [
      909.4816138633263,
      113.89641095890411
    ],
    [
      912.4096486565727,
      116.78885714285715
    ],
    [
      915.3376834498189,
      112.11846666666665
    ],
    [
      918.2657182430652,
      118.55221621621622
    ],
    [
      921.1937530363115,
      117.31309523809524
    ],
    [
      924.1217878295578,
      110.7575238095238
    ],
    [
      927.049822622804,
      124.01120512820513
    ],
    [
      929.9778574160504,
      119.19529166666666
    ],
    [
      932.9058922092966,
      108.41992207792208
    ],
    [
      935.833927002543,
      130.02353333333332
    ],
    [
      938.7619617957893,
      117.73015000000001
    ],
    [
      941.6899965890354,
      103.76062162162161
    ],
    [
      944.6180313822819,
      118.04003508771929
    ],
    [
      947.546066175528,
      101.16941666666668
    ],
    [
      950.4741009687745,
      121.00367647058825
    ],
    [
      953.4021357620206,
      134.99393333333336
    ],
    [
      956.3301705552669,
      111.75596721311476
    ],
    [
      959.2582053485131,
      123.687
    ],
    [
      962.1862401417595,
      90.37315789473686
    ],
    [
      965.1142749350057,
      128.7228
    ],
    [
      968.0423097282521,
      134.78942857142857
    ],
    [
      970.9703445214984,
      109.21928358208953
    ],
    [
      973.8983793147447,
      141.76542857142857
    ],
    [
      976.826414107991,
      120.23032183908046
    ],
    [
      979.7544489012372,
      123.40844444444446
    ],
    [
      982.6824836944836,
      129.52086956521737
    ],
    [
      985.6105184877298,
      127.54560000000001
    ],
    [
      988.5385532809762,
      124.17694949494951
    ],
    [
      991.4665880742224,
      118.78695454545453
    ],
    [
      994.3946228674687,
      117.81858064516129
    ],
    [
      997.3226576607149,
      108.50930612244898
    ],
    [
      1000.2506924539613,
      123.65444155844156
    ],
    [
      1003.1787272472075,
      98.68239999999997
    ],
    [
      1006.1067620404539,
      117.82370833333334
    ],
    [
      1009.0347968337002,
      126.79955555555556
    ],
    [
      1011.9628316269464,
      117.3143023255814
    ],
    [
      1014.8908664201928,
      118.52235955056182
    ],
    [
      1017.818901213439,
      130.3836875
    ],
    [
      1020.7469360066854,
      125.80405633802818
    ],
    [
      1023.6749707999315,
      100.906
    ],
    [
      1026.6030055931778,
      122.31844444444445
    ],
    [
      1029.5310403864241,
      122.71205555555555
    ],
    [
      1032.4590751796704,
      112.13553488372094
    ],
    [
      1035.3871099729167,
      131.33595652173912
    ],
    [
      1038.315144766163,
      116.48521428571428
    ],
    [
      1041.2431795594093,
      59.48599999999999
    ],
    [
      1044.1712143526556,
      124.15933333333334
    ],
    [
      1047.099249145902,
      115.44767213114753
    ],
    [
      1050.0272839391482,
      118.128
    ],
    [
      1052.9553187323945,
      151.5589411764706
    ],
    [
      1055.8833535256408,
      122.32143820224718
    ],
    [
      1058.811388318887,
      118.43218604651165
    ],
    [
      1061.7394231121334,
      116.04142857142857
    ],
    [
      1064.6674579053797,
      121.24228571428571
    ],
    [
      1067.595492698626,
      116.2968
    ],
    [
      1070.5235274918723,
      125.54968888888888
    ],
    [
      NaN,
      NaN
    ],
    [
      1076.3795970783647,
      140.47027500000002
    ],
    [
      1079.3076318716112,
      119.98957303370787
    ],
    [
      1082.2356666648573,
      104.8215064935065
    ],
    [
      1085.1637014581038,
      107.3084923076923
    ],
    [
      1088.0917362513499,
      122.30526470588235
    ],
    [
      1091.0197710445962,
      105.266
    ],
    [
      1093.9478058378425,
      116.26217647058824
    ],
    [
      1096.8758406310887,
      122.57004301075268
    ],
    [
      1099.803875424335,
      111.10245454545453
    ],
    [
      1102.7319102175813,
      117.10251020408163
    ],
    [
      1105.6599450108276,
      119.32515254237288
    ],
    [
      1108.587979804074,
      131.2464705882353
    ],
    [
      1111.5160145973202,
      85.22816666666668
    ],
    [
      1114.4440493905665,
      121.25679545454545
    ],
    [
      1117.3720841838128,
      128.86030769230769
    ],
    [
      1120.3001189770591,
      148.08623076923078
    ],
    [
      1123.2281537703054,
      132.55882142857143
    ],
    [
      1126.1561885635517,
      116.44077083333333
    ],
    [
      1129.084223356798,
      210.56
    ],
    [
      1132.0122581500443,
      114.88070833333333
    ],
    [
      1134.9402929432906,
      120.10184782608695
    ],
    [
      1137.8683277365367,
      118.50404999999999
    ],
    [
      1140.7963625297832,
      103.23133333333332
    ],
    [
      NaN,
      NaN
    ],
    [
      1146.6524321162758,
      125.29158139534883
    ],
    [
      1149.580466909522,
      119.76703703703704
    ],
    [
      1152.5085017027682,
      117.54803773584905
    ],
    [
      1155.4365364960147,
      117.32781176470588
    ],
    [
      1158.3645712892608,
      109.82842857142857
    ],
    [
      1161.2926060825073,
      114.65211111111111
    ],
    [
      1164.2206408757534,
      126.19399999999999
    ],
    [
      1167.1486756689997,
      114.64
    ],
    [
      1170.076710462246,
      111.31130769230771
    ],
    [
      1173.0047452554923,
      114.16845652173912
    ],
    [
      1175.9327800487386,
      117.038
    ],
    [
      1178.8608148419848,
      113.46209677419355
    ],
    [
      1181.7888496352311,
      131.657625
    ],
    [
      1184.7168844284774,
      109.5996896551724
    ],
    [
      1187.6449192217237,
      125.15244444444444
    ],
    [
      1190.57295401497,
      119.98741176470587
    ],
    [
      1193.5009888082163,
      123.80460526315788
    ],
    [
      1196.4290236014626,
      126.65934615384616
    ],
    [
      1199.357058394709,
      121.0187397260274
    ],
    [
      1202.2850931879552,
      107.79895238095237
    ],
    [
      1205.2131279812015,
      113.10117647058826
    ],
    [
      1208.1411627744478,
      106.39838888888889
    ],
    [
      1211.0691975676941,
      123.36
    ],
    [
      1213.9972323609404,
      117.67112765957447
    ],
    [
      1216.9252671541867,
      122.91002564102564
    ],
    [
      1219.853301947433,
      115.694575
    ],
    [
      1222.7813367406793,
      112.42885714285714
    ],
    [
      1225.7093715339256,
      116.92900000000002
    ],
    [
      1228.6374063271717,
      106.95830927835053
    ],
    [
      1231.5654411204182,
      110.49543529411766
    ],
    [
      1234.4934759136643,
      125.43257971014494
    ],
    [
      1237.4215107069108,
      125.63178947368421
    ],
    [
      1240.3495455001569,
      102.78995061728396
    ],
    [
      1243.2775802934032,
      108.72646315789474
    ],
    [
      1246.2056150866497,
      96.66073684210525
    ],
    [
      1249.1336498798958,
      129.13138144329898
    ],
    [
      1252.0616846731423,
      121.3858888888889
    ],
    [
      1254.9897194663884,
      115.14139999999999
    ],
    [
      1257.9177542596346,
      121.53106493506493
    ],
    [
      1260.845789052881,
      125.36237037037036
    ],
    [
      1263.7738238461272,
      111.20936842105264
    ],
    [
      1266.7018586393735,
      116.93541176470588
    ],
    [
      1269.6298934326198,
      112.99467368421053
    ],
    [
      1272.5579282258661,
      130.32672340425532
    ],
    [
      1275.4859630191124,
      104.83000000000001
    ],
    [
      1278.4139978123587,
      119.436
    ],
    [
      1281.342032605605,
      145.1392380952381
    ],
    [
      1284.2700673988513,
      110.60204545454548
    ],
    [
      1287.1981021920976,
      135.83444444444444
    ],
    [
      1290.126136985344,
      66.46199999999999
    ],
    [
      1293.0541717785902,
      129.791
    ],
    [
      1295.9822065718365,
      120.87003125
    ],
    [
      1298.9102413650826,
      133.2572
    ],
    [
      1301.838276158329,
      101.43945882352943
    ],
    [
      1304.7663109515752,
      113.88835416666666
    ],
    [
      1307.6943457448217,
      121.70942857142857
    ],
    [
      1310.6223805380678,
      122.35597183098591
    ],
    [
      1313.5504153313143,
      120.02459999999999
    ],
    [
      1316.4784501245606,
      120.35159999999999
    ],
    [
      1319.4064849178067,
      119.38315151515151
    ],
    [
      1322.3345197110532,
      122.81063999999999
    ],
    [
      1325.2625545042993,
      167.9192
    ],
    [
      1328.1905892975458,
      125.47115789473683
    ],
    [
      1331.1186240907919,
      114.71950588235293
    ],
    [
      1334.0466588840382,
      111.67455882352942
    ],
    [
      1336.9746936772844,
      112.34191666666669
    ],
    [
      1339.9027284705307,
      109.09657142857142
    ],
    [
      1342.830763263777,
      126.51526315789474
    ],
    [
      1345.7587980570233,
      124.6048947368421
    ],
    [
      1348.6868328502696,
      104.87922580645161
    ],
    [
      1351.614867643516,
      122.04082051282052
    ],
    [
      1354.5429024367622,
      121.41385454545456
    ],
    [
      1357.4709372300085,
      129.52291891891892
    ],
    [
      1360.3989720232548,
      119.66254901960785
    ],
    [
      1363.3270068165011,
      119.87654166666665
    ],
    [
      NaN,
      NaN
    ],
    [
      1369.1830764029937,
      127.11729411764706
    ],
    [
      1372.11111119624,
      115.19490909090908
    ],
    [
      1375.039145989486,
      122.18023529411764
    ],
    [
      1377.9671807827326,
      108.34525
    ],
    [
      1380.8952155759787,
      150.59717647058824
    ],
    [
      1383.8232503692252,
      123.6216
    ],
    [
      1386.7512851624715,
      112.73777419354838
    ],
    [
      1389.6793199557176,
      102.30196491228071
    ],
    [
      1392.607354748964,
      117.44884615384615
    ],
    [
      1395.5353895422102,
      111.26903157894736
    ],
    [
      1398.4634243354567,
      115.78302702702702
    ],
    [
      1401.3914591287028,
      126.53090909090909
    ],
    [
      1404.3194939219493,
      124.63793103448278
    ],
    [
      1407.2475287151954,
      125.17946153846154
    ],
    [
      1410.1755635084417,
      143.4814
    ],
    [
      1413.103598301688,
      105.89923809523809
    ],
    [
      1416.0316330949343,
      108.4597
    ],
    [
      1418.9596678881808,
      118.25880000000001
    ],
    [
      1421.8877026814268,
      127.84229268292682
    ],
    [
      NaN,
      NaN
    ],
    [
      1427.7437722679194,
      127.86014285714286
    ],
    [
      1430.6718070611657,
      118.13838095238096
    ],
    [
      1433.599841854412,
      121.15145238095238
    ],
    [
      1436.5278766476583,
      116.28667857142858
    ],
    [
      1439.4559114409046,
      107.73284210526313
    ],
    [
      1442.383946234151,
      121.38346666666666
    ],
    [
      1445.3119810273972,
      129.23958823529412
    ],
    [
      1448.2400158206435,
      107.61988095238095
    ],
    [
      1451.1680506138896,
      110.37116363636362
    ],
    [
      1454.0960854071361,
      135.12372151898734
    ],
    [
      1457.0241202003824,
      105.51345945945945
    ],
    [
      1459.9521549936287,
      113.04133333333334
    ],
    [
      1462.880189786875,
      125.48202127659575
    ],
    [
      1465.808224580121,
      129.52491176470588
    ],
    [
      1468.7362593733676,
      116.87102127659574
    ],
    [
      1471.6642941666137,
      115.61664
    ],
    [
      1474.5923289598602,
      110.12428571428572
    ],
    [
      1477.5203637531063,
      116.54513043478262
    ],
    [
      1480.4483985463526,
      119.42856818181818
    ],
    [
      1483.3764333395989,
      121.62882352941178
    ],
    [
      1486.3044681328452,
      109.52173913043477
    ],
    [
      1489.2325029260917,
      95.21983333333333
    ],
    [
      1492.1605377193378,
      104.02339999999998
    ],
    [
      1495.088572512584,
      116.13170786516855
    ],
    [
      1498.0166073058303,
      130.21142857142857
    ],
    [
      1500.9446420990766,
      124.06631999999999
    ],
    [
      1503.872676892323,
      119.97082666666667
    ],
    [
      1506.8007116855692,
      134.805
    ],
    [
      1509.7287464788155,
      106.77696551724138
    ],
    [
      1512.6567812720618,
      129.268358974359
    ],
    [
      1515.5848160653081,
      113.69055263157895
    ],
    [
      1518.5128508585544,
      104.66517073170733
    ],
    [
      1521.4408856518007,
      99.94562162162163
    ],
    [
      1524.368920445047,
      127.56611764705882
    ],
    [
      1527.2969552382933,
      127.79189361702127
    ],
    [
      1530.2249900315396,
      106.98027272727272
    ],
    [
      1533.153024824786,
      113.57725
    ],
    [
      1536.0810596180322,
      112.16078431372549
    ],
    [
      1539.0090944112785,
      111.78322388059702
    ],
    [
      1541.9371292045246,
      116.06486597938144
    ],
    [
      1544.865163997771,
      40.30199999999999
    ]
  ]
  var colorStops = {
    "x": -6628.495839572883,
    "y": 0,
    "x2": 3917.7892421475262,
    "y2": 0,
    "type": "linear",
    "global": true,
    "colorStops": [
      {
        "offset": 0.0009482011838777932,
        "color": "rgba(67,161,251,1)"
      },
      {
        "coord": -6618.495839572883,
        "color": "#fc0019",
        "offset": 0.00094820118387779321
      },
      {
        "coord": -6612.63976998639,
        "color": "#fc0019",
        "offset": 0.0015034743953560947
      },
      {
        "coord": -6612.63976998639,
        "color": "rgba(67,161,251,1)",
        "offset": 0.00150347439535609471
      },
      {
        "coord": -6100.23368116829,
        "color": "rgba(67,161,251,1)",
        "offset": 0.05008988039970732
      },
      {
        "coord": -6100.23368116829,
        "color": "#fc0019",
        "offset": 0.050089880399707321
      },
      {
        "coord": -6094.377611581797,
        "color": "#fc0019",
        "offset": 0.05064515361118562
      },
      {
        "coord": -6094.377611581797,
        "color": "rgba(67,161,251,1)",
        "offset": 0.050645153611185621
      },
      {
        "coord": -5681.52470573407,
        "color": "rgba(67,161,251,1)",
        "offset": 0.0897919150204058
      },
      {
        "coord": -5681.52470573407,
        "color": "#fc0019",
        "offset": 0.08979191502040581
      },
      {
        "coord": -5675.668636147578,
        "color": "#fc0019",
        "offset": 0.0903471882318841
      },
      {
        "coord": -5675.668636147578,
        "color": "rgba(67,161,251,1)",
        "offset": 0.09034718823188411
      },
      {
        "coord": 455.6362209101515,
        "color": "rgba(67,161,251,1)",
        "offset": 0.6717182406496643
      },
      {
        "coord": 455.6362209101515,
        "color": "#fc0019",
        "offset": 0.67171824064966431
      },
      {
        "coord": 461.4922904966441,
        "color": "#fc0019",
        "offset": 0.6722735138611426
      },
      {
        "coord": 461.4922904966441,
        "color": "rgba(67,161,251,1)",
        "offset": 0.67227351386114261
      },
      {
        "coord": 821.6405700659377,
        "color": "rgba(67,161,251,1)",
        "offset": 0.7064228163670581
      },
      {
        "coord": 821.6405700659377,
        "color": "#fc0019",
        "offset": 0.70642281636705811
      },
      {
        "coord": 827.4966396524302,
        "color": "#fc0019",
        "offset": 0.7069780895785364
      },
      {
        "coord": 827.4966396524302,
        "color": "rgba(67,161,251,1)",
        "offset": 0.7069780895785364
      },
      {
        "coord": 1038.315144766163,
        "color": "rgba(67,161,251,1)",
        "offset": 0.7269679251917551
      },
      {
        "coord": 1038.315144766163,
        "color": "#fc0019",
        "offset": 0.7269679251917551
      },
      {
        "coord": 1044.1712143526556,
        "color": "#fc0019",
        "offset": 0.7275231984032334
      },
      {
        "coord": 1044.1712143526556,
        "color": "rgba(67,161,251,1)",
        "offset": 0.7275231984032334
      },
      {
        "coord": 1287.1981021920976,
        "color": "rgba(67,161,251,1)",
        "offset": 0.7505670366795829
      },
      {
        "coord": 1287.1981021920976,
        "color": "#fc0019",
        "offset": 0.7505670366795829
      },
      {
        "coord": 1293.0541717785902,
        "color": "#fc0019",
        "offset": 0.7511223098910612
      },
      {
        "coord": 1293.0541717785902,
        "color": "rgba(67,161,251,1)",
        "offset": 0.7511223098910612
      },
      {
        "coord": 1541.9371292045246,
        "color": "rgba(67,161,251,1)",
        "offset": 0.7747214213788889
      },
      {
        "coord": 1541.9371292045246,
        "color": "#fc0019",
        "offset": 0.7747214213788889
      },
      {
        "coord": 1547.7931987910172,
        "color": "#fc0019",
        "offset": 0.7752766945903672
      },
      {
        "coord": 1547.7931987910172,
        "color": "rgba(67,161,251,1)",
        "offset": 0.7752766945903672
      },
      {
        "coord": 1705.907077626317,
        "color": "rgba(67,161,251,1)",
        "offset": 0.7902690713002815
      },
      {
        "coord": 1705.907077626317,
        "color": "#fc0019",
        "offset": 0.7902690713002815
      },
      {
        "coord": 1711.7631472128094,
        "color": "#fc0019",
        "offset": 0.7908243445117596
      },
      {
        "coord": 1711.7631472128094,
        "color": "rgba(67,161,251,1)",
        "offset": 0.7908243445117596
      },
      {
        "coord": 1802.5322258034446,
        "color": "rgba(67,161,251,1)",
        "offset": 0.7994310792896734
      },
      {
        "coord": 1802.5322258034446,
        "color": "#fc0019",
        "offset": 0.7994310792896734
      },
      {
        "coord": 1808.388295389937,
        "color": "#fc0019",
        "offset": 0.7999863525011517
      },
      {
        "coord": 1808.388295389937,
        "color": "rgba(67,161,251,1)",
        "offset": 0.7999863525011517
      },
      {
        "coord": 1948.9339654657588,
        "color": "rgba(67,161,251,1)",
        "offset": 0.8133129095766309
      },
      {
        "coord": 1948.9339654657588,
        "color": "#fc0019",
        "offset": 0.8133129095766309
      },
      {
        "coord": 1954.7900350522516,
        "color": "#fc0019",
        "offset": 0.8138681827881092
      },
      {
        "coord": 1954.7900350522516,
        "color": "rgba(67,161,251,1)",
        "offset": 0.8138681827881092
      },
      {
        "coord": 1978.2143133982217,
        "color": "rgba(67,161,251,1)",
        "offset": 0.8160892756340222
      },
      {
        "coord": 1978.2143133982217,
        "color": "#fc0019",
        "offset": 0.8160892756340222
      },
      {
        "coord": 1984.0703829847146,
        "color": "#fc0019",
        "offset": 0.8166445488455008
      },
      {
        "coord": 1984.0703829847146,
        "color": "rgba(67,161,251,1)",
        "offset": 0.8166445488455008
      },
      {
        "coord": 2227.097270824156,
        "color": "rgba(67,161,251,1)",
        "offset": 0.8396883871218501
      },
      {
        "coord": 2227.097270824156,
        "color": "#fc0019",
        "offset": 0.8396883871218501
      },
      {
        "coord": 2232.953340410649,
        "color": "#fc0019",
        "offset": 0.8402436603333284
      },
      {
        "coord": 2232.953340410649,
        "color": "rgba(67,161,251,1)",
        "offset": 0.8402436603333284
      },
      {
        "coord": 2297.3701058620672,
        "color": "rgba(67,161,251,1)",
        "offset": 0.8463516656595897
      },
      {
        "coord": 2297.3701058620672,
        "color": "#fc0019",
        "offset": 0.8463516656595897
      },
      {
        "coord": 2303.22617544856,
        "color": "#fc0019",
        "offset": 0.8469069388710679
      },
      {
        "coord": 2303.22617544856,
        "color": "rgba(67,161,251,1)",
        "offset": 0.8469069388710679
      },
      {
        "coord": 3901.9331725610336,
        "color": "rgba(67,161,251,1)",
        "offset": 0.9984965256046439
      },
      {
        "coord": 3901.9331725610336,
        "color": "#fc0019",
        "offset": 0.9984965256046439
      },
      {
        "coord": 3907.7892421475262,
        "color": "#fc0019",
        "offset": 0.9990517988161222
      },
      {
        "offset": 0.9990517988161222,
        "color": "rgba(67,161,251,1)"
      }
    ]
  }

  var rect = [colorStops.x2 - colorStops.x, 228]

  const scale = 21

  function main() {
    var $app = $('<div id="app" class="box">').height(env.h);
    $('#main').html($app);

    $app.append(draw()).css({ 'overflow-x': 'auto', 'overflow-y': 'hidden' })
  }

  function draw() {
    var canvas = ce('canvas', { width: rect[0], height: rect[1], position: 'relative' })

    var ctx = canvas.getContext('2d');

    ctx.clearRect(colorStops.x, 0, colorStops.x2, rect[1])
    ctx.translate(-colorStops.x, 0);
    linerGradient2(ctx, canvas)

    // fillImage(ctx, canvas)
    return canvas;
  }

  function linerGradient(ctx, canvas) {
    var gradient = ctx.createLinearGradient(0, 0, canvas.width, 0);

    gradient.addColorStop(0, 'blue')
    gradient.addColorStop(0.25, 'white')
    gradient.addColorStop(0.5, 'purple')
    gradient.addColorStop(0.75, 'red')
    gradient.addColorStop(1, 'yellow')

    ctx.fillStyle = gradient;

    ctx.fill()
  }

  function linerGradient2(ctx) {
    ctx.save()
    var colorStopsLen = colorStops.colorStops.length
    var gradient = ctx.createLinearGradient(colorStops.x, colorStops.y, colorStops.x2, rect[1] - colorStops.y2);
    for (var i = 0; i < colorStopsLen; i++) {
      gradient.addColorStop(colorStops.colorStops[i].offset, colorStops.colorStops[i].color)
    }

    ctx.strokeStyle = gradient
    ctx.lineWidth = 1
    ctx.lineCap = "butt"
    ctx.lineJoin = "bevel"

    var len = points.length;
    i = 0;
    first = true;
    ctx.beginPath()
    if (0) {
      for (;i < len; i++) {
        if (isNaN(points[i][0]) || isNaN(points[i][1])) {
          first = true;
          continue
        }
        ctx[first ? 'moveTo' : 'lineTo'](points[i][0], points[i][1])
        first = false;
      }
    } else {
      var result = graph.getBoundingBox(points, true)

      while (i < len) {
        i += drawNonMono(ctx, points, i, len, len, 1, result.min, result.max, 0.5, undefined, false) + 1
      }
    }
    
    ctx.stroke()

    // ctx.restore()
    ctx.beginPath()
    ctx.moveTo(colorStops.x, 50)
    ctx.lineTo(colorStops.x2, 50)
    ctx.lineWidth = 50
    ctx.stroke()

    ctx.restore()
    ctx.beginPath()
    first = true
    var radius = 2
    var coord = 0
    var k = 0
    for (i = 0; i < colorStopsLen; i++) {
      if (colorStops.colorStops[i].coord && coord !== colorStops.colorStops[i].coord) {
        ctx.arc(colorStops.colorStops[i].coord, rect[1]-radius, radius, 0, 2*Math.PI)
        ctx.fillText(String(colorStops.colorStops[i].coord).replace(/(\.\d{2})\d*$/, '$1'),
          colorStops.colorStops[i].coord, k % 2 === 0 ? (rect[1]-radius - 10) : (rect[1]-radius - 20));
        first = false;
        coord = colorStops.colorStops[i].coord
        k++;
      }
    }
    ctx.fill()
    // ctx.closePath()
  }

  function radialGradient(ctx, canvas) {
    var radialGradient = ctx.createRadialGradient(20, 20, 10, 150, 150, 100);

    gradient.addColorStop(0, 'blue')
    gradient.addColorStop(0.4, 'yellow')
    gradient.addColorStop(1, 'red')
  }


  function fillImage(ctx, canvas) {
    var img = new Image();
    img.src = '/assets/img/pic.jpg';

    img.onload = function() {
      var pattern = ctx.createPattern(img, 'no-repeat');
      ctx.fillStyle = pattern;
      ctx.fillRect(0, 0, 200, 200)
    }
  }

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*   http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied.  See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// Poly path support NaN point
var vec2Min = vec2.min;
var vec2Max = vec2.max;
var scaleAndAdd = vec2.scaleAndAdd;
var v2Copy = vec2.copy; // Temporary variable

var v = [];
var cp0 = [];
var cp1 = [];

function isPointNull(p) {
  return isNaN(p[0]) || isNaN(p[1]);
}

/**
 * Draw smoothed line in non-monotone, in may cause undesired curve in extreme
 * situations. This should be used when points are non-monotone neither in x or
 * y dimension.
 */

function drawNonMono(ctx, points, start, segLen, allLen, dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls) {
  var prevIdx = 0;
  var idx = start;

  for (var k = 0; k < segLen; k++) {
    var p = points[idx];

    if (idx >= allLen || idx < 0) {
      break;
    }

    if (isPointNull(p)) {
      if (connectNulls) {
        idx += dir;
        continue;
      }

      break;
    }

    if (idx === start) {
      ctx[dir > 0 ? 'moveTo' : 'lineTo'](p[0], p[1]);
      v2Copy(cp0, p);
    } else {
      if (smooth > 0) {
        var nextIdx = idx + dir;
        var nextP = points[nextIdx];

        if (connectNulls) {
          // Find next point not NaN
          while (nextP && isPointNull(points[nextIdx])) {
            nextIdx += dir;
            nextP = points[nextIdx];
          }
        }

        var ratioNextSeg = 0.5;
        var prevP = points[prevIdx];
        var nextP = points[nextIdx]; // Last point

        if (!nextP || isPointNull(nextP)) {
          v2Copy(cp1, p);
        } else {
          // If next data is NaN in not connect case
          if (isPointNull(nextP) && !connectNulls) {
            nextP = p;
          }

          vec2.sub(v, nextP, prevP);
          var lenPrevSeg;
          var lenNextSeg;

          if (smoothMonotone === 'x' || smoothMonotone === 'y') {
            var dim = smoothMonotone === 'x' ? 0 : 1;
            lenPrevSeg = Math.abs(p[dim] - prevP[dim]);
            lenNextSeg = Math.abs(p[dim] - nextP[dim]);
          } else {
            lenPrevSeg = vec2.dist(p, prevP);
            lenNextSeg = vec2.dist(p, nextP);
          } // Use ratio of seg length


          ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);
          scaleAndAdd(cp1, p, v, -smooth * (1 - ratioNextSeg));
        } // Smooth constraint


        vec2Min(cp0, cp0, smoothMax);
        vec2Max(cp0, cp0, smoothMin);
        vec2Min(cp1, cp1, smoothMax);
        vec2Max(cp1, cp1, smoothMin);
        ctx.bezierCurveTo(cp0[0], cp0[1], cp1[0], cp1[1], p[0], p[1]); // cp0 of next segment

        scaleAndAdd(cp0, p, v, smooth * ratioNextSeg);
      } else {
        ctx.lineTo(p[0], p[1]);
      }
    }

    prevIdx = idx;
    idx += dir;
  }

  return k;
}

  return main;
})
